home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
System
/
MRAC
/
Positions
/
p-replace
< prev
next >
Wrap
Text File
|
1998-08-11
|
521b
|
21 lines
p-replace seed position new-item sequence
0-based
This function enables items occupying specific locations in a list to be replaced by other items. Specific locations may include: a position number n, first, last and rnd.
(p-replace nil 'last '-6 '(2 2 2 2 3 3 3))
=> (2 2 2 2 3 3 -6)
(p-replace nil 'first 'm '(a b c d e f))
=> (m b c d e f)
(p-replace nil 'rnd 'm '(a b c d e f))
=> (a b c d e m) ...
(p-replace .34 'rnd 'm '(a b c d e f))
=> (a m c d e f)
(p-replace nil 2 'm '(a b c d e f))
=> (a b m d e f)